<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/2/22
  Time: 16:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>


<%
    request.setCharacterEncoding("UTF-8");
String username =  request.getParameter("username");
String password =  request.getParameter("password");
String check_pwd = request.getParameter("check_pwd");
String sex = request.getParameter("sex");
String email = request.getParameter("email");
String date = request.getParameter("date");
if (null != username && username.equals("sa") && null != password && password.equals("sa")){
    session.setAttribute("login",username);
    Cookie cookie = new Cookie("login","sa");
    cookie.setMaxAge(5*160);
    response.addCookie(cookie);
    session.setMaxInactiveInterval(10*60);
    RequestDispatcher rd = request.getRequestDispatcher("welcome.jsp");
    rd.forward(request,response);
}
%>
你输入的注册信息是<br>
用户名:<%=username%><br>
密码:<%=password%><br>
性别:<%=sex%><br>
电子邮件地址:<%=email%><br>
出生日期:<%=date%>

</body>
</html>
